﻿using IBll;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace We.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class DepartmentController : ControllerBase, IDepartmentbLL
    {

         public DepartmentController(IDepartmentbLL bll)
        {
            Bll = bll;
        }

        public IDepartmentbLL Bll { get; }

        [HttpPost]
        public Task<int> AddDepartment(Department department)
        {
            return Bll.AddDepartment(department);
        }

        [HttpGet]
        public List<Department> departments()
        {
            return Bll.departments();
        }

        [HttpGet]
        public dynamic ShowDepartment(string? name)
        {
            return Bll.ShowDepartment(name);
        }
    }
}
